<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
        <form action="{:url('SlideItem/addPost')}" method="post" class="layui-form js-ajax-form margin-top-20">
        <div class="smart-widget widget-blue">
            <div class="layui-card">
                <div class="layui-card-header">{:lang('ADMIN_SLIDEITEM_ADD')}</div>
                <div class="layui-card-body">
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('TITLE')}</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="post[title]" required placeholder="{:lang('PLEASE_ENTER')}{:lang('TITLE')}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('LINK')}</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="post[url]" placeholder="{:lang('PLEASE_ENTER')}{:lang('LINK')}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('description')}</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="post[url]" value="{$result.description}" placeholder="{:lang('PLEASE_ENTER')}{:lang('description')}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('CONTENT')}</label>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea" name="post[content]" rows="5" placeholder="{:lang('PLEASE_FILL_IN')}{:lang('CONTENT')}"></textarea>
                        </div>
                    </div>

                    <!-- 图片 -->
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('UPLOAD_IMAGE')}</label>
                        <div class="layui-input-block">
                            <div class="upload-image">
                                <input type="hidden" name="post[image]" id="thumb" value="">
                                <a href="javascript:uploadOneImage('{:lang('UPLOAD_IMAGE')}','#thumb');">
                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumb-preview"
                                         width="135"/>
                                </a>
                                <input type="button" class="layui-btn layui-btn-danger layui-btn-sm"
                                       onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                                       value="{:lang('CANCEL_PICTURE')}">
                            </div>
                        </div>
                    </div>

                    <!-- 排序号 -->
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('SORT')}</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="post[list_order]" value="10000">
                        </div>
                    </div>
                    <!-- 属性 -->
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('ATTRIBUTE')}</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="post[status]" title="{:lang('IS_HIDE')}" value="0">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="post[slide_id]" value="{$slide_id}">
                            <button type="submit" class="layui-btn layui-btn-normal js-ajax-submit">{:lang('ADD')}</button>
                            <a class="layui-btn layui-btn-primary" href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">{:lang('BACK')}</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<include file="public@footer"/>
